<floatFuncs>

	My last design was for multiple double arrays in nodes be used together, and for each iteration,
	some set of doubles be concat into 1 array, and call the floatFunc on that array,
	then copy the doubles from the array back where they came from.
	
	Instead, it may be more efficient for floatFuncs to have X inputs and 1 output,
	and use the same set of doubles as before.
	
	Because multiple reads and writes of the same index may be needed for some evolved algorithm,
	multiple floatFunc calls, in sequence and/or conditionally are executed during 1 node excution.
	That may or may not make it less efficient.
	
	Knowing which indexs are input and which are output is an advantage over constant size array.
	
	If mouse, joystick, microphone, etc are copied into the array (from the last design)
	many times per second, then (in this design) how would those be copied?
	Would mouse be getMouseX() and getMouseY()? The old design would have been getMouseXAndY(double[]).
	
	Can it scale to a double array size 50? It may need 50
	function calls (more if multiple calls per index), but less if some are only inputs.
	
	Probably there are more inputs than outputs.
	
	Example of a function that cant be made efficient by this model:
	Use standard deviation to normalize size 50 array.
	The most efficient way with this model is:
	Also use a size 3 array of these things:
		quantity,
		sum (then average),
		sum of squares (then average square) (then standard deviation).
	* Iterate over all 50 to count to 50 and get the sum.
	* Quickly divide sum by quantity.
	* Iterate over all 50 to get the squares (relative to the average).
	* Quickly divide the sum of squares by quantity then sqrt it, giving the standard deviation.
	* Iterate over all 50 to normalize by using the average and standard deviation.
	Ok, that was not as inefficient as I thought.
	
	!!!But it is still a little over 150 function calls, and that is much slower than 3 loops in 1 function call for the same algorithm!!!
	Its slower, but it can handle variable size array (if done as a node algorithm).
	
	It would be faster, and a little more complex, for some functions (including +, -, *, /, sine, etc)
	to instead be lists of int that are interpreted by the code executing a node, in the same function call.
	That way, it is at worst 3 times slower than 1 function that takes 50 parameters, and that is fast enough.
	
	I had almost rejected such interpreted int lists before because of the complication with
	returning more than 1 double, but now that I accept the constraint of each action returning
	exactly 1 double, it is not too complex. I think its a good idea.
	
	<important>
		Try to think of a useful algorithm that this model of having 1 output (and any number of inputs)
		per function call has a Big-O problem doing, and if such an algorithm is possible,
		then this 1-output model would be rejected.
	</important>
	
	Assuming no Big-O flaw is found, 2 types of action will be allowed:
	* javaFloatFunc: Java object with a function which operates on a double array, with some other parameter(s) to tell which part(s) of the array. I'm not sure of the parameters.
	* interpFloatFunc: Array of int that representes some hard-coded action, like a = b + c, but does not need a function call by itself
		because it is interpreted.
		
	<funcInterface>

		<question importance="high">
			How should a javaFloatFunc take inputs and output to a double array?
			<possibleAnswer>
				//This is a flawed way to do it:
				public class APlusBTimesC implements AudivolvDFunc{
					public double run(double d[], int startIndex){
						return d[startIndex] + d[startIndex+1]*d[startIndex+2]; 
					}
				}
			</possibleAnswer>
			<possibleAnswer>
				//This is a complex way to do it:
				public class APlusBTimesC implements AudivolvDFunc{
					public double run(double d...){
						return d[0] + d[1]*d[2];
					}
				}
			</possibleAnswer>
			<possibleAnswer>
				//This is a more complex and faster way to do it:
				public class APlusBTimesC implements AudivolvDFunc{
					public double run(double d...){
						//same as run3(double,double,double)
						return d[0] + d[1]*d[2];
					}
					public double run0(){...} //interface function
					public double run1(double a){...} //interface function
					public double run2(double a, double b){...} //interface function
					public double run3(double a, double b, double c){
						return a + b*c;
					}
					public double run4(double a, double b, double c, double d){...} //interface function
					//...
				}
				Optimized compiled evolved code could use the run3 func,
				but dynamic code would have to use run(double d...) and create an array dynamicly.
				<question>
					Should there be a common AudivolvDFunc superinterface,
					and AudivolvDFunc0, AudivolvDFunc3, etc funcs for specific parameter types?
					That way, the type would tell you which func to call.
					???
				</question>
			</possibleAnswer>
			???
		</question>
		
		<question importance="medium">
			How should a javaFloatFunc take inputs and output to parts of a node?
			Its easy to view those parts of the node as a double array and do it to the array instead of the node.
		</question>
		
		<question importance="high">
			How should a interpFloatFunc take inputs and output to a double array?
			<possibleAnswer>
				Given int x, write to index x after reading indexs x+1, x+2...
			</possibleAnswer>
			<possibleAnswer>
				Given an int array, write to the first int index after reading from the other indexs.
			</possibleAnswer>
			<possibleAnswer>
				Use a stack of doubles instead of an array.
				<question>Where would the parameter of PUSH come from?</question>
			</possibleAnswer>
			<possibleAnswer>
				Hard-code the indexs in the interpFloatFunc.
				For example, + of index12 and 14 returns to index5. Many + interpFloatFuncs would be needed.
				Maybe a small section of the global interpFloatFunc array could be allocated
				for a more ordered way of choosing indexs... bits0-3 are the func name. bits4-7 are first index,
				and bits8-11 and bits12-15 would be the 2 parameter indexs.
				But that probably does not increase efficiency.
				It does let a interpFloatFunc call be saved in an int or short,
				but it costs too much complexity.
			</possibleAnswer>
			???
		</question>
		
		<question importance="high">
			How should a interpFloatFunc take inputs and output to parts of a node?
			<possibleAnswer>
				Its easy to view those parts of the node as a double array
				and do it to the array instead of the node.
			</possibleAnswer>
			<possibleAnswer>
				It could probably be inlined if an ITERATOR over the parts of a node was defined,
				because it would be inside the loop of that iterator.
				<question>
					Should the iterator keep 1 int array and its loops change the ints
					in that array, and use that as the interface to the interpFloatFuncs?
				</question>
			</possibleAnswer>
			???
		</question>

	</funcInterface>
	
	<iteratorOverPartsOfNode>
		<question>
			Given a new network with unique array size relationships (depending on * and ^ etc),
			how can a standard ITERATOR iterate over those?
			<question>
				How to define which method of iteration over combinations of arrays to use?
				<example>
					For example, 2 small arrays should be inputs of every func call in an iteration,
					and those should be concat to 5 doubles at a time from an array size 5*(2^7).
					Example node array oversimplified definition{
						[a] size is constant 2
						[b] size is constant 1
						[c] size is constant 5
						[d] size is 7
						[e] size is a^d
						[f] size is c*e
					}
					This syntax may help: a+b+f/c
					f divided by c means to iterate that many times,
					and for c quantity of doubles to be used each iteration.
					But that does not makse sense for a or b because they should iterate only once.
					Instead, the number of iterations should be in 1 place,
					and what to include in each iteration in a different place.
					IterationSize: f/e
					IterateWhat: a+b+f/e
					<example>
						A more complex example is to iterate over f in 2 different ways and concat those.
						IterationSize: f
						IterateWhat: f/e+f/f
						The function has c+1 parameters, because f/e equals c and f/f equals 1.
					</example>
					<example>
						Another complex example is to iterate a number of times not equal to any array size.
						IterationSize: c*d^a
						IterateWhat: c/c+d/d+a
						Each func call has 1+1+2 parameters, because c/c and d/d are 1, and a is 2.
					</example>
					f can be divided by f, by c, by e,
					and in some way maybe by a or d because they are connected by ^.
				</example>
				<question>
					If an array x is size y*y, and iteration size is x/y, which y is used?
					What if I want func params to include x/yFirst+x/ySecond?
					<possibleSolution>Require y*y to be written as y0*y1 or something unique</possibleSolution>
					<possibleSolution>
						Do not allow duplicates in those definitions, but allow duplicates as index in node (a-z), without duplicating the array data, and multiply an array by its virtual duplicate.
					</possibleSolution>
					???
				</question>
				<question>
					If an array g is size s*s, and an array h is size s*g,
					how to choose the right s in iteration size definition?
					???
				</question>
				<question>
					If an array g is size s^s, how to use s in iteration size definition?
					???
				</question>
			</question>
			Concat (for func params) is only allowed if array size is constant.
		</question>
		<howAreFuncsInMemoryAndExecuted importance="high">		
			The answers to these questions depend on how an sequence (and conditional tree etc)
			of javaFloatFuncs and interpFloatFuncs will be in memory and how they are executed.
			The most common 2 cases are execution many thousands of times as an audio func,
			and execution at most a few times per iteration as part of a node algorithm.
		</howAreFuncsInMemoryAndExecuted>
	</iteratorOverPartsOfNode>
	
	<question>
		How can a javaFloatFunc call other javaFloatFuncs and interpFloatFuncs?
	</question>
	
	<question importance="high">
		Should parts of double arrays be temporarily allocated for temporary calculations,
		or should those things be dynamicly allocated by the stateless function that needs it?
		If it can be allocated on the java stack, that would be efficient, but that is not easy to do.
		Allocating a new small double array for a stateless function call is impractical,
		and managing a pool of small arrays is complex.
	</question>
	
	<question importance="low">
		Should a interpFloatFunc be able to call a javaFloatFunc?
		If funcs can evolve and be optimized as interpFloatFunc, that could be useful.
		???
	</question>
	
	<stringSyntaxForArrayAndIterationSizesEtc>
		Some node/network indexs (A-Za-z) should contain Integer instead of array,
		and that integer should be defined the same way as arrays, but allow more operators than "*" and "^".
		It should also allow "=" for multiple uses of the same array,
		"/" for selecting more than 1 double from an array per func call,
		and "+" for concat things.
		<possibleProblem>
			Because indexs (max 52) would be used for more than arrays,
			52 may not be enough, but it probably will be.
		</possibleProblem>
		<example>
			[a] size is constant 2
			[b] size is constant 5
			[c] size is 6
			[d] size is b*c
			[e] size is =d
			[f] size is d/c
			[g] size is d/b
			[h] size is d*e
		</example>
		<question>
			The opposite operator "/" exists because of "*".
			Should there be an opposite operator of "^"?
			It would be "n'th root", but I want a 1-char name for it. Maybe it should be "`".
			If size of x is y^z, then x`z would mean iterate over x and func size z,
			which in math is better written this way: ??? ((y^z)/(y^z))*z ??? Something like that.
			For example, 2^5 would have func size 5.
			(y^z)`z equals z.
			...
			If duplicates index in nodes are not allowed in these math strings,
			then operators "/" and "`" are not needed. Instead, write "(y^z)`z" as "y^z" --> "z"
		</question>
		<question>
			If (y^z)`z equals z, then I also need an operator that would equal y.
			(y^z)OPERATORz equals y. What is OPERATOR?
			* and / are opposites because * is symmetric, but it did result in the need for duplicate index of x in a node if x*x is used.
			Similarly, ^ needs 2 methods of choosing an opposite, 1 for x and 1 for y, in x^y.
		</question>
		<question>
			How to use func param size x+y and iteration size x^y and array size x^y?
			That could probably not be done, but this similar thing could be done:
				func param size x+y (or only x or only y) and iteration size x*(x^y) and array size x^y?
			<question>
				How would the func know which index of x is being used?
				It would know which index of y because they are each a parameter index.
				<question>Should the func be allowed to know which index of x is being used?</question>
			</question>
		</question>
	</stringSyntaxForArrayAndIterationSizesEtc>

</floatFuncs>